Page({

  /**
   * 页面的初始数据
   */
  data: {
    bankBg: '', //银行卡的背景颜色
    bankNum: 2,
    bank: [
      { img: "../../../images/bank/zggsyh.png", name: "工商银行" },
      { img: "../../../images/bank/zgyh.png", name: "中国银行" },
      { img: "../../../images/bank/shyh.png", name: "招商银行" },
      { img: "../../../images/bank/hxyh.png", name: "华夏银行" },
      { img: "../../../images/bank/zxyh.png", name: "中信银行" },
      { img: "../../../images/bank/gfyh.png", name: "广发银行" },
      { img: "../../../images/bank/bjyh.png", name: "北京银行" },
      { img: "../../../images/bank/jsyh.png", name: "建设银行" },
      { img: "../../../images/bank/jtyh.png", name: "交通银行" },
      { img: "../../../images/bank/pfyh.png", name: "浦发银行" },
      { img: "../../../images/bank/shyh.png", name: "上海银行" },
      { img: "../../../images/bank/xyyh.png", name: "兴业银行" },
      { img: "../../../images/bank/nyyh.png", name: "农业银行" },
      { img: "../../../images/bank/msyh.png", name: "民生银行" },
      { img: "../../../images/bank/ycyh.png", name: "邮储银行" },
      { img: "../../../images/bank/payh.png", name: "平安银行" },
    ]

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var num = this.data.bankNum;
    if (num <= 6) {
      this.setData({
        bankBg: 'red-bg'
      })
    } else if (num > 6 && num <= 11) {
      this.setData({
        bankBg: 'yellow-bg'
      })
    } else if (num > 11 && num <= 14) {
      this.setData({
        bankBg: 'green-bg'
      })
    } else if (num > 14 && num <= 15) {
      this.setData({
        bankBg: 'blue-bg'
      })
    } else {
      this.setData({
        bankBg: 'other-bg'
      })
    }

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function (options) {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})